package com.eric.seo.onpage;

import org.jsoup.nodes.Element;

import com.alibaba.fastjson.JSONObject;

public class ResultItem {
	
	private JSONObject json = new JSONObject();
	
	/**
	 * JSONObject that stores the result of a single element
	 * @param item Name of the Check Function
	 * @param element The Element Triggering Reporting
	 * @param level Violation Level
	 * @param detail Detail
	 * @return ResultItem
	 */
	public ResultItem (String item,Element element,String level,String detail) {
		json.put("item", item);
		json.put("element", element.toString());
		json.put("level", level);
		json.put("detail", detail);
	}
	
	/**
	 * JSONObject that stores the result of a single element
	 * @param item Name of the Check Function
	 * @param element The Element Triggering Reporting
	 * @param level Violation Level
	 * @param detail Detail
	 * @return ResultItem
	 */
	public ResultItem (String item,String element,String level,String detail) {
		json.put("item", item);
		json.put("element", element);
		json.put("level", level);
		json.put("detail", detail);
	}
	
	public JSONObject json () {
		return json;
	}
}
